package com.sc.admin.base.controller;

import com.sc.admin.base.service.IRouteService;
import com.sc.admin.base.vo.route.RouteListVO;
import com.sc.common.response.Response;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@AllArgsConstructor
@RequestMapping("admin-base")
public class IndexController {

    private final IRouteService routeService;

    @GetMapping("index")
    public String index() {
        return "base/index";
    }


    @GetMapping("get-menu")
    @ResponseBody
    public Response<List<RouteListVO>> getMenu() {
        return Response.success(routeService.getMenu());
    }
}
